#/bin/sh

#/***************************************************************************
# *   Copyright (C) 2007 by Rob Clark                                       *
# *   hyakuhei@gmail.com                                                    *
# *                                                                         *
# *   This program is free software; you can redistribute it and/or modify  *
# *   it under the terms of the GNU General Public License as published by  *
# *   the Free Software Foundation; either version 2 of the License, or     *
# *   (at your option) any later version.                                   *
# *                                                                         *
# *   This program is distributed in the hope that it will be useful,       *
# *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
# *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
# *   GNU General Public License for more details.                          *
# *                                                                         *
# *   You should have received a copy of the GNU General Public License     *
# *   along with this program; if not, write to the                         *
# *   Free Software Foundation, Inc.,                                       *
# *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
# ***************************************************************************/

##########################################
# This script uses a number of variables #
# The default settings should work on    #
# any machine. Please only change them   #
# if you know what you are doing! Thanks #
##########################################
# Support:                               #
# http://code.google.com/p/e-apps        #
# hyakuhei@gmail.com                     #
##########################################

export PKG_CONFIG_PATH=/usr/lib/pkgconfig:/usr/local/lib/pkgconfig

#e.g COMMON_OPTS="--prefix=/path/to/whatever"
COMMON_OPTS=""

#Set any specific compile flags here
CFLAGS="-O2 -pipe"

#Set any specific make options here
MAKEOPTS="-j2"

###Edit below this line at your own risk

ROOTDIR=`pwd`
CXXFLAGS="{CFLAGS}"

function make_f(){
    nice $NICENESS make $MAKEOPTS
}

function make_install(){
    sudo make install
}

cd $ROOTDIR ; cd e17/libs/eet
./autogen.sh $COMMON_OPTS && make_f  &&  make_install || exit 1

cd $ROOTDIR ; cd e17/libs/edb
./autogen.sh $COMMON_OPTS && make_f  &&  make_install || exit 1

cd $ROOTDIR ; cd e17/libs/evas
./autogen.sh $COMMON_OPTS --enable-gl-x11 && make_f  &&  make_install || exit 1

cd $ROOTDIR ; cd e17/libs/ecore
./autogen.sh $COMMON_OPTS --enable-ecore-config && make_f  &&  make_install || exit 1

cd $ROOTDIR ; cd e17/libs/efreet
./autogen.sh $COMMON_OPTS && make_f  &&  make_install || exit 1

cd $ROOTDIR ; cd e17/libs/epeg
./autogen.sh $COMMON_OPTS && make_f  &&  make_install || exit 1

cd $ROOTDIR ; cd e17/libs/embryo
./autogen.sh $COMMON_OPTS && make_f  &&  make_install || exit 1

cd $ROOTDIR ; cd e17/libs/edje
./autogen.sh $COMMON_OPTS && make_f  &&  make_install || exit 1

cd $ROOTDIR ; cd e17/libs/epsilon
./autogen.sh $COMMON_OPTS && make_f  &&  make_install || exit 1

cd $ROOTDIR ; cd e17/libs/esmart
./autogen.sh $COMMON_OPTS && make_f  &&  make_install || exit 1

sudo ldconfig

cd $ROOTDIR ; cd e17/libs/emotion
./autogen.sh $COMMON_OPTS && make_f  &&  make_install || exit 1

cd $ROOTDIR ; cd e17/libs/ewl
./autogen.sh $COMMON_OPTS && make_f  &&  make_install || exit 1

sudo ldconfig

cd $ROOTDIR ; cd e17/apps/entice
./autogen.sh $COMMON_OPTS && make_f  &&  make_install || exit 1

#Does Not Compile
#cd $ROOTDIR ; cd e17/apps/elicit
#./autogen.sh $COMMON_OPTS && make_f  &&  make_install || exit 1

cd $ROOTDIR ; cd e17/apps/entrance
./autogen.sh $COMMON_OPTS && make_f  &&  make_install || exit 1

cd $ROOTDIR ; cd e17/apps/e
./autogen.sh $COMMON_OPTS && make_f  &&  make_install || exit 1

cd $ROOTDIR ; cd e17/libs/engrave
./autogen.sh $COMMON_OPTS && make_f  &&  make_install || exit 1

sudo ldconfig

cd $ROOTDIR ; cd e17/libs/etk
./autogen.sh $COMMON_OPTS && make_f  &&  make_install || exit 1

sudo ldconfig

#@@ No Compile
#cd $ROOTDIR ; cd misc/engage
#./autogen.sh $COMMON_OPTS && make_f  &&  make_install || exit 1

cd $ROOTDIR ; cd e17/apps/e_utils
./autogen.sh $COMMON_OPTS && make_f  &&  make_install || exit 1

# doesn't exist
#cd $ROOTDIR ; cd e17/apps/e_modules
#./autogen.sh $COMMON_OPTS && make_f  &&  make_install || exit 1

#@@ no compile
#cd $ROOTDIR ; cd misc/elapse
#./autogen.sh $COMMON_OPTS && make_f  &&  make_install || exit 1

#@@ no compile 
#cd $ROOTDIR ; cd misc/enotes
#./autogen.sh $COMMON_OPTS && make_f  &&  make_install || exit 1
